<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
<meta name="theme-color" content="#222">
<meta name="generator" content="Hexo 4.2.1">
  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png">
  <link rel="icon" type="image/png" sizes="32x32" href="/images/dute_favicon_32x32.png">
  <link rel="icon" type="image/png" sizes="16x16" href="/images/dute_favicon_16x16.png">
  <link rel="mask-icon" href="/images/logo.svg" color="#222">
  <link rel="manifest" href="/images/manifest.json">
  <meta name="msapplication-config" content="/images/browserconfig.xml">
  <meta http-equiv="Cache-Control" content="no-transform">
  <meta http-equiv="Cache-Control" content="no-siteapp">
  <meta name="google-site-verification" content="mpI5dkydstZXl6UcDCppqktXK0bbvqdZ6LkZ3KNk4Iw">
  <meta name="baidu-site-verification" content="code-a1LksZX2Ds">

<link rel="stylesheet" href="/css/main.css">


<link rel="stylesheet" href="/lib/font-awesome/css/font-awesome.min.css">
  <link rel="stylesheet" href="//cdn.jsdelivr.net/gh/fancyapps/fancybox@3/dist/jquery.fancybox.min.css">

<script id="hexo-configurations">
    var NexT = window.NexT || {};
    var CONFIG = {"hostname":"whitestore.top","root":"/","scheme":"Gemini","version":"7.8.0","exturl":true,"sidebar":{"position":"left","display":"post","padding":18,"offset":12,"onmobile":false},"copycode":{"enable":true,"show_result":false,"style":null},"back2top":{"enable":true,"sidebar":true,"scrollpercent":true},"bookmark":{"enable":false,"color":"#222","save":"auto"},"fancybox":true,"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"style":"tabs","active":null,"storage":true,"lazyload":false,"nav":null},"algolia":{"hits":{"per_page":10},"labels":{"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}},"localsearch":{"enable":true,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false},"motion":{"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},"path":"search.xml"};
  </script>

  <meta name="description" content="个人笔记回顾">
<meta property="og:type" content="article">
<meta property="og:title" content="Jmeter压力测试回顾(一)">
<meta property="og:url" content="https://whitestore.top/2021/01/18/jmeter-test1/index.html">
<meta property="og:site_name" content="爱看书的阿东">
<meta property="og:description" content="个人笔记回顾">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://gitee.com/lazyTimes/imageReposity/raw/master/img/20210109193629.png">
<meta property="article:published_time" content="2021-01-18T15:34:49.000Z">
<meta property="article:modified_time" content="2023-07-16T06:28:09.223Z">
<meta property="article:author" content="阿东">
<meta property="article:tag" content="个人笔记回顾">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://gitee.com/lazyTimes/imageReposity/raw/master/img/20210109193629.png">

<link rel="canonical" href="https://whitestore.top/2021/01/18/jmeter-test1/">


<script id="page-configurations">
  // https://hexo.io/docs/variables.html
  CONFIG.page = {
    sidebar: "",
    isHome : false,
    isPost : true,
    lang   : 'zh-CN'
  };
</script>

  <title>Jmeter压力测试回顾(一) | 爱看书的阿东</title>
  






  <noscript>
  <style>
  .use-motion .brand,
  .use-motion .menu-item,
  .sidebar-inner,
  .use-motion .post-block,
  .use-motion .pagination,
  .use-motion .comments,
  .use-motion .post-header,
  .use-motion .post-body,
  .use-motion .collection-header { opacity: initial; }

  .use-motion .site-title,
  .use-motion .site-subtitle {
    opacity: initial;
    top: initial;
  }

  .use-motion .logo-line-before i { left: initial; }
  .use-motion .logo-line-after i { right: initial; }
  </style>
</noscript>

<link rel="alternate" href="/atom.xml" title="爱看书的阿东" type="application/atom+xml">
</head>

<body itemscope itemtype="http://schema.org/WebPage">
  <div class="container use-motion">
    <div class="headband"></div>

    <header class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-container">
  <div class="site-nav-toggle">
    <div class="toggle" aria-label="切换导航栏">
      <span class="toggle-line toggle-line-first"></span>
      <span class="toggle-line toggle-line-middle"></span>
      <span class="toggle-line toggle-line-last"></span>
    </div>
  </div>

  <div class="site-meta">

    <a href="/" class="brand" rel="start">
      <span class="logo-line-before"><i></i></span>
      <h1 class="site-title">爱看书的阿东</h1>
      <span class="logo-line-after"><i></i></span>
    </a>
      <p class="site-subtitle" itemprop="description">赐他一块白色石头，石头上写着新名</p>
  </div>

  <div class="site-nav-right">
    <div class="toggle popup-trigger">
        <i class="fa fa-search fa-fw fa-lg"></i>
    </div>
  </div>
</div>




<nav class="site-nav">
  <ul id="menu" class="menu">
        <li class="menu-item menu-item-home">

    <a href="/" rel="section"><i class="fa fa-fw fa-home"></i>首页</a>

  </li>
        <li class="menu-item menu-item-tags">

    <a href="/tags/" rel="section"><i class="fa fa-fw fa-tags"></i>标签</a>

  </li>
        <li class="menu-item menu-item-categories">

    <a href="/categories/" rel="section"><i class="fa fa-fw fa-th"></i>分类</a>

  </li>
        <li class="menu-item menu-item-archives">

    <a href="/archives/" rel="section"><i class="fa fa-fw fa-archive"></i>归档</a>

  </li>
        <li class="menu-item menu-item-sitemap">

    <a href="/sitemap.xml" rel="section"><i class="fa fa-fw fa-sitemap"></i>站点地图</a>

  </li>
      <li class="menu-item menu-item-search">
        <a role="button" class="popup-trigger"><i class="fa fa-search fa-fw"></i>搜索
        </a>
      </li>
  </ul>
</nav>



  <div class="search-pop-overlay">
    <div class="popup search-popup">
        <div class="search-header">
  <span class="search-icon">
    <i class="fa fa-search"></i>
  </span>
  <div class="search-input-container">
    <input autocomplete="off" autocapitalize="off"
           placeholder="搜索..." spellcheck="false"
           type="search" class="search-input">
  </div>
  <span class="popup-btn-close">
    <i class="fa fa-times-circle"></i>
  </span>
</div>
<div id="search-result">
  <div id="no-result">
    <i class="fa fa-spinner fa-pulse fa-5x fa-fw"></i>
  </div>
</div>

    </div>
  </div>

</div>
    </header>

    

  <span class="exturl github-corner" data-url="aHR0cHM6Ly9naXRodWIuY29tL2xhenlUaW1lcw==" title="Follow me on GitHub" aria-label="Follow me on GitHub"><svg width="80" height="80" viewBox="0 0 250 250" aria-hidden="true"><path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path><path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path><path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path></svg></span>


    <main class="main">
      <div class="main-inner">
        <div class="content-wrap">
          

          <div class="content post posts-expand">
            

    
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="https://whitestore.top/2021/01/18/jmeter-test1/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.gif">
      <meta itemprop="name" content="阿东">
      <meta itemprop="description" content="随遇而安">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="爱看书的阿东">
    </span>
      <header class="post-header">
        <h1 class="post-title" itemprop="name headline">
          Jmeter压力测试回顾(一)
        </h1>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>

              <time title="创建时间：2021-01-18 23:34:49" itemprop="dateCreated datePublished" datetime="2021-01-18T23:34:49+08:00">2021-01-18</time>
            </span>
              <span class="post-meta-item">
                <span class="post-meta-item-icon">
                  <i class="fa fa-calendar-check-o"></i>
                </span>
                <span class="post-meta-item-text">更新于</span>
                <time title="修改时间：2023-07-16 14:28:09" itemprop="dateModified" datetime="2023-07-16T14:28:09+08:00">2023-07-16</time>
              </span>
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              <span class="post-meta-item-text">分类于</span>
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/%E6%B5%8B%E8%AF%95/" itemprop="url" rel="index"><span itemprop="name">测试</span></a>
                </span>
            </span>

          
            <span class="post-meta-item" title="阅读次数" id="busuanzi_container_page_pv" style="display: none;">
              <span class="post-meta-item-icon">
                <i class="fa fa-eye"></i>
              </span>
              <span class="post-meta-item-text">阅读次数：</span>
              <span id="busuanzi_value_page_pv"></span>
            </span>
  
  <span class="post-meta-item">
    
      <span class="post-meta-item-icon">
        <i class="fa fa-comment-o"></i>
      </span>
      <span class="post-meta-item-text">Valine：</span>
    
    <a title="valine" href="/2021/01/18/jmeter-test1/#valine-comments" itemprop="discussionUrl">
      <span class="post-comments-count valine-comment-count" data-xid="/2021/01/18/jmeter-test1/" itemprop="commentCount"></span>
    </a>
  </span>
  
  <br>
            <span class="post-meta-item" title="本文字数">
              <span class="post-meta-item-icon">
                <i class="fa fa-file-word-o"></i>
              </span>
                <span class="post-meta-item-text">本文字数：</span>
              <span>4.2k</span>
            </span>
            <span class="post-meta-item" title="阅读时长">
              <span class="post-meta-item-icon">
                <i class="fa fa-clock-o"></i>
              </span>
                <span class="post-meta-item-text">阅读时长 &asymp;</span>
              <span>4 分钟</span>
            </span>
            <div class="post-description">个人笔记回顾</div>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
        <h1 id="回顾jmeter压力测试（一）"><a href="#回顾jmeter压力测试（一）" class="headerlink" title="回顾jmeter压力测试（一）"></a>回顾jmeter压力测试（一）</h1><h2 id="前言："><a href="#前言：" class="headerlink" title="前言："></a>前言：</h2><p>这一部分是个人对于很久之前笔记进行整理，有需要的时候再进行回顾。</p>
<a id="more"></a>

<h2 id="什么是压力测试？"><a href="#什么是压力测试？" class="headerlink" title="什么是压力测试？"></a>什么是压力测试？</h2><p>顾名思义：压力测试，就是  被测试的系统，在一定的访问压力下，看程序运行是否稳定/服务器运行是否稳定（资源占用情况）</p>
<p>比如： 2000个用户同时到一个购物网站购物，这些用户打开页面的速度是否会变慢，或者网站是否会奔溃，为了保证系统的正常可用，一般都会使用压力测试来测试网站的性能和瓶颈</p>
<h2 id="什么是apach-Jmeter"><a href="#什么是apach-Jmeter" class="headerlink" title="什么是apach Jmeter:"></a>什么是apach Jmeter:</h2><p>以下摘自百度百科：</p>
<p>Apache JMeter是Apache组织开发的基于Java的压力测试工具。用于对软件做压力测试，它最初被设计用于Web应用测试，但后来扩展到其他测试领域。 它可以用于测试静态和动态资源，例如静态文件、Java <span class="exturl" data-url="aHR0cHM6Ly9iYWlrZS5iYWlkdS5jb20vaXRlbS/lsI/mnI3liqHnqIvluo8vNDE0ODgzNg==" title="https://baike.baidu.com/item/小服务程序/4148836">小服务程序<i class="fa fa-external-link"></i></span>、CGI 脚本、Java 对象、数据库、<span class="exturl" data-url="aHR0cHM6Ly9iYWlrZS5iYWlkdS5jb20vaXRlbS9GVFAvMTM4Mzk=" title="https://baike.baidu.com/item/FTP/13839">FTP<i class="fa fa-external-link"></i></span> 服务器， 等等。JMeter 可以用于对服务器、网络或对象模拟巨大的负载，来自不同压力类别下测试它们的强度和分析整体性能。另外，JMeter能够对应用程序做功能/<span class="exturl" data-url="aHR0cHM6Ly9iYWlrZS5iYWlkdS5jb20vaXRlbS/lm57lvZLmtYvor5UvMTkyNTczMg==" title="https://baike.baidu.com/item/回归测试/1925732">回归测试<i class="fa fa-external-link"></i></span>，通过创建带有断言的脚本来验证你的程序返回了你期望的结果。为了最大限度的灵活性，JMeter允许<span class="exturl" data-url="aHR0cHM6Ly9iYWlrZS5iYWlkdS5jb20vaXRlbS/kvb/nlKjmraPliJnooajovr7lvI8vNjU1NTQ4NA==" title="https://baike.baidu.com/item/使用正则表达式/6555484">使用正则表达式<i class="fa fa-external-link"></i></span>创建断言。</p>
<h2 id="常用压力测试工具比较："><a href="#常用压力测试工具比较：" class="headerlink" title="常用压力测试工具比较："></a>常用压力测试工具比较：</h2><h3 id="loadrunner"><a href="#loadrunner" class="headerlink" title="loadrunner"></a>loadrunner</h3><pre><code>性能稳定，压测结果及细粒度大，可以自定义脚本进行压测，但是太过于重大，功能比较繁多。并且是一个**收费软件**</code></pre><h3 id="apache-ab-单接口压测最方便"><a href="#apache-ab-单接口压测最方便" class="headerlink" title="apache ab(单接口压测最方便)"></a>apache ab(单接口压测最方便)</h3><pre><code>模拟多线程并发请求,ab命令对发出负载的计算机要求很低，既不会占用很多CPU，也不会占用太多的内存，但却会给目标服务器造成巨大的**负载**, 简单DDOS攻击等。</code></pre><h3 id="webbench"><a href="#webbench" class="headerlink" title="webbench"></a>webbench</h3><pre><code>webbench首先fork出多个子进程，每个子进程都循环做web访问测试。子进程把访问的结果通过pipe告诉父进程，父进程做最终的统计结果。</code></pre><h2 id="Apache-JMeter的功能"><a href="#Apache-JMeter的功能" class="headerlink" title="Apache JMeter的功能:"></a>Apache JMeter的功能:</h2><ul>
<li>网络-HTTP，HTTPS（Java，NodeJS，PHP，ASP.NET等）</li>
<li>SOAP / REST Web服务</li>
<li>FTP</li>
<li>支持JDBC的数据库</li>
<li>LDAP</li>
<li>通过JMS的面向消息的中间件（MOM）</li>
<li>邮件-SMTP（S），POP3（S）和IMAP（S）</li>
<li>本机命令或Shell脚本</li>
<li>TCP协议</li>
<li>Java对象</li>
</ul>
<h2 id="使用场景及优点"><a href="#使用场景及优点" class="headerlink" title="使用场景及优点"></a>使用场景及优点</h2><p>1）功能测试<br>2）压力测试<br>3）分布式压力测试<br>4）纯java开发<br>5）上手容易，高性能<br>4）提供测试数据分析<br>5）各种报表数据图形展示</p>
<h2 id="如何学习："><a href="#如何学习：" class="headerlink" title="如何学习："></a>如何学习：</h2><p>注意，对于实操性非常强的软件来说，jmeter更多的是适合上机实操而不是理论记忆。目前还是推荐结合各种实际场景结合博客能更加深入的把握各种功能的使用。</p>
<p>官方网站：<span class="exturl" data-url="aHR0cHM6Ly9qbWV0ZXIuYXBhY2hlLm9yZy8=" title="https://jmeter.apache.org/">https://jmeter.apache.org/<i class="fa fa-external-link"></i></span></p>
<p>社区：<span class="exturl" data-url="aHR0cHM6Ly90ZXN0ZXJob21lLmNvbS8=" title="https://testerhome.com/">https://testerhome.com/<i class="fa fa-external-link"></i></span> （由于个人主要为后端这里主要为测试的社区，里面有不少测试的干货，感兴趣可以了解）</p>
<h2 id="我要怎么做？"><a href="#我要怎么做？" class="headerlink" title="我要怎么做？"></a>我要怎么做？</h2><h3 id="配置jdk环境："><a href="#配置jdk环境：" class="headerlink" title="配置jdk环境："></a>配置jdk环境：</h3><p>由于Jmeter是由java编写的，使用之前需要事先安装安装<strong>jdk1.8</strong>以上版本以上的号环境，由于Jdk的配置网上一抓一大把，这里不做过多的介绍</p>
<h3 id="下载Jmeter："><a href="#下载Jmeter：" class="headerlink" title="下载Jmeter："></a>下载Jmeter：</h3><p>目前最新版本的<code>Jmeter5.4</code>需要JDK1.8的支持：</p>
<p>官方下载地址：<span class="exturl" data-url="aHR0cHM6Ly9qbWV0ZXIuYXBhY2hlLm9yZy9kb3dubG9hZF9qbWV0ZXIuY2dp" title="https://jmeter.apache.org/download_jmeter.cgi">https://jmeter.apache.org/download_jmeter.cgi<i class="fa fa-external-link"></i></span></p>
<p>windows：<span class="exturl" data-url="aHR0cHM6Ly9hcGFjaGVtaXJyb3Iuc2cud3VjaG5hLmNvbS8vam1ldGVyL2JpbmFyaWVzL2FwYWNoZS1qbWV0ZXItNS40LnRneg==" title="https://apachemirror.sg.wuchna.com//jmeter/binaries/apache-jmeter-5.4.tgz">https://apachemirror.sg.wuchna.com//jmeter/binaries/apache-jmeter-5.4.tgz<i class="fa fa-external-link"></i></span></p>
<p>Linux：<span class="exturl" data-url="aHR0cHM6Ly9hcGFjaGVtaXJyb3Iuc2cud3VjaG5hLmNvbS8vam1ldGVyL2JpbmFyaWVzL2FwYWNoZS1qbWV0ZXItNS40LnppcA==" title="https://apachemirror.sg.wuchna.com//jmeter/binaries/apache-jmeter-5.4.zip">https://apachemirror.sg.wuchna.com//jmeter/binaries/apache-jmeter-5.4.zip<i class="fa fa-external-link"></i></span></p>
<p>下载完成之后进行对应的解压即可：</p>
<h2 id="jmeter包结构解释："><a href="#jmeter包结构解释：" class="headerlink" title="jmeter包结构解释："></a>jmeter包结构解释：</h2><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><span class="line">bin：最常用的包,里面包含了各种可执行文件</span><br><span class="line">docs：java doc文档</span><br><span class="line">extras：插件拓展的包</span><br><span class="line">    + lib:核心的依赖包</span><br><span class="line">    + ext:核心包</span><br><span class="line">    + junit:单元测试包	</span><br><span class="line">licenses：开源许可</span><br><span class="line">lib：源码包</span><br><span class="line">printable_docs：官方文档</span><br><span class="line">NOTICE JMeter 简单信息说明</span><br><span class="line">README.md JMeter 官方基本介绍</span><br></pre></td></tr></table></figure>



<p>先介绍一下最常用的Bin包内容：</p>
<pre><code>jmeter.bat: windows启动文件：
jmeter: mac或者linux启动文件：
jmeter-server：mac或者Liunx分布式压测使用的启动文件
jmeter-server.bat：mac或者Liunx分布式压测使用的启动文件
jmeter.properties: 核心配置文件</code></pre><h2 id="改变jmeter的GUI界面语言版本"><a href="#改变jmeter的GUI界面语言版本" class="headerlink" title="改变jmeter的GUI界面语言版本"></a>改变jmeter的GUI界面语言版本</h2><h3 id="控制台修改"><a href="#控制台修改" class="headerlink" title="控制台修改"></a>控制台修改</h3><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">menu -&gt; options -&gt; choose language</span><br></pre></td></tr></table></figure>

<h3 id="配置文件修改"><a href="#配置文件修改" class="headerlink" title="配置文件修改"></a>配置文件修改</h3><pre><code>bin目录 -&gt;` jmeter.properties`
默认 `#language=en`
改为` language=zh_CN `</code></pre><h2 id="详细介绍："><a href="#详细介绍：" class="headerlink" title="详细介绍："></a>详细介绍：</h2><p>由于实操性比较强，对于jmeter详细功能的介绍，最终还是建议落实到各种尝试，同时如果平时接触不到的话，完全可以等到使用的时候再进行回顾。</p>
<p>另外，jmeter无论对于开发和测试都是有帮助的，对于测试来说基本是必须会的一个技能，作为开发在平时某些情况下也可能会用到</p>
<h1 id="摘抄："><a href="#摘抄：" class="headerlink" title="摘抄："></a>摘抄：</h1><h2 id="接口测试的要点："><a href="#接口测试的要点：" class="headerlink" title="接口测试的要点："></a>接口测试的要点：</h2><p>下面是根据博客截图，具体请看<strong>“如何学习”</strong>这一篇章。</p>
<p><img src="https://gitee.com/lazyTimes/imageReposity/raw/master/img/20210109193629.png" alt=""></p>
<h2 id="接口响应状态码："><a href="#接口响应状态码：" class="headerlink" title="接口响应状态码："></a>接口响应状态码：</h2><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br><span class="line">78</span><br><span class="line">79</span><br><span class="line">80</span><br></pre></td><td class="code"><pre><span class="line">http 请求状态码详细</span><br><span class="line">使用 ASP.NET&#x2F;PHP&#x2F;JSP 或者 javascript 都会用到 http 的不同状态，一些常见的状态码</span><br><span class="line">为：</span><br><span class="line"></span><br><span class="line">200 – 服务器成功返回网页 404 – 请求的网页不存在 503 – 服务不可用</span><br><span class="line"></span><br><span class="line">1xx（临时响应）</span><br><span class="line">表示临时响应并需要请求者继续执行操作的状态代码</span><br><span class="line">100 （继续） 请求者应当继续提出请求。 服务器返回此代码表示已收到请求的</span><br><span class="line">第一部分，正在等待其余部分。</span><br><span class="line">101 （切换协议） 请求者已要求服务器切换协议，服务器已确认并准备切换。</span><br><span class="line">2xx （成功）</span><br><span class="line">表示成功处理了请求的状态代码</span><br><span class="line">200 （成功） 服务器已成功处理了请求。 通常，这表示服务器提供了请求的网</span><br><span class="line">页。</span><br><span class="line">201 （已创建） 请求成功并且服务器创建了新的资源。</span><br><span class="line">202 （已接受） 服务器已接受请求，但尚未处理。</span><br><span class="line">203 （非授权信息） 服务器已成功处理了请求，但返回的信息可能来自另一来源。</span><br><span class="line">204 （无内容） 服务器成功处理了请求，但没有返回任何内容。</span><br><span class="line">205 （重置内容） 服务器成功处理了请求，但没有返回任何内容。</span><br><span class="line">206 （部分内容） 服务器成功处理了部分 GET 请求。</span><br><span class="line"></span><br><span class="line">3xx （重定向）</span><br><span class="line">。 表示要完成请求，需要进一步操作。  通常，这些状态代码用来重定向</span><br><span class="line">300 （多种选择） 针对请求，服务器可执行多种操作。服务器可根据请求者 (user</span><br><span class="line">agent) 选择一项操作，或提供操作列表供请求者选择。</span><br><span class="line">301 （永久移动） 请求的网页已永久移动到新位置。 服务器返回此响应（对 GET</span><br><span class="line">或 HEAD 请求的响应）时，会自动将请求者转到新位置。</span><br><span class="line">302 （临时移动） 服务器目前从不同位置的网页响应请求，但请求者应继续使用</span><br><span class="line">原有位置来进行以后的请求。</span><br><span class="line">303 （查看其他位置） 请求者应当对不同的位置使用单独的 GET 请求来检索响</span><br><span class="line">应时，服务器返回此代码。</span><br><span class="line">304 （未修改） 自从上次请求后，请求的网页未修改过。 服务器返回此响应时，</span><br><span class="line">不会返回网页内容。</span><br><span class="line">305 （使用代理） 请求者只能使用代理访问请求的网页。 如果服务器返回此响</span><br><span class="line">应，还表示请求者应使用代理。</span><br><span class="line">307 （临时重定向） 服务器目前从不同位置的网页响应请求，但请求者应继续使</span><br><span class="line">用原有位置来进行以后的请求。</span><br><span class="line"></span><br><span class="line">4xx（请求错误）</span><br><span class="line">这些状态代码表示请求可能出错，妨碍了服务器的处理</span><br><span class="line">400 （错误请求） 服务器不理解请求的语法。</span><br><span class="line">401 （未授权） 请求要求身份验证。 对于需要登录的网页，服务器可能返回此</span><br><span class="line">响应。</span><br><span class="line">403 （禁止） 服务器拒绝请求。</span><br><span class="line">404 （未找到） 服务器找不到请求的网页。</span><br><span class="line">405 （方法禁用） 禁用请求中指定的方法。</span><br><span class="line">406 （不接受） 无法使用请求的内容特性响应请求的网页。</span><br><span class="line">407 （需要代理授权） 此状态代码与 401（未授权）类似，但指定请求者应当授</span><br><span class="line">权使用代理。</span><br><span class="line">408 （请求超时） 服务器等候请求时发生超时。</span><br><span class="line">409 （冲突） 服务器在完成请求时发生冲突。 服务器必须在响应中包含有关冲</span><br><span class="line">突的信息。</span><br><span class="line">410 （已删除） 如果请求的资源已永久删除，服务器就会返回此响应。</span><br><span class="line">411 （需要有效长度） 服务器不接受不含有效内容长度标头字段的请求。</span><br><span class="line">412 （未满足前提条件）服务器未满足请求者在请求中设置的其中一个前提条件。</span><br><span class="line">413 （请求实体过大） 服务器无法处理请求，因为请求实体过大，超出服务器的</span><br><span class="line">处理能力。</span><br><span class="line">414 （请求的 URI 过长） 请求的 URI（通常为网址）过长，服务器无法处理。</span><br><span class="line">415 （不支持的媒体类型） 请求的格式不受请求页面的支持。</span><br><span class="line">416 （请求范围不符合要求） 如果页面无法提供请求的范围，则服务器会返回此</span><br><span class="line">状态代码。</span><br><span class="line">417 （未满足期望值） 服务器未满足”期望”请求标头字段的要求。</span><br><span class="line">关注公众号--测试驿栈</span><br><span class="line">博客地址： https:&#x2F;&#x2F;testerhome.com&#x2F;topics&#x2F;21318</span><br><span class="line">5xx（服务器错误）</span><br><span class="line">。 这些状态代码表示服务器在尝试处理请求时发生内部错误。  这些错误可能是服务</span><br><span class="line">器本身的错误</span><br><span class="line">500 （服务器内部错误） 服务器遇到错误，无法完成请求。</span><br><span class="line">501 （尚未实施） 服务器不具备完成请求的功能。 例如，服务器无法识别请求</span><br><span class="line">方法时可能会返回此代码。</span><br><span class="line">502 （错误网关） 服务器作为网关或代理，从上游服务器收到无效响应。</span><br><span class="line">503 （服务不可用） 服务器目前无法使用（由于超载或停机维护）。 通常，这</span><br><span class="line">只是暂时状态。</span><br><span class="line">504 （网关超时） 服务器作为网关或代理，但是没有及时从上游服务器收到请求。</span><br><span class="line">505 （HTTP 版本不受支持） 服务器不支持请求中所用的 HTTP 协议版本。</span><br><span class="line">428 Precondition Required (要求先决条件)</span><br><span class="line">429 Too Many Requests (太多请求)</span><br><span class="line">431 Request Header Fields Too Large (请求头字段太大)</span><br><span class="line">511 Network Authentication Required (要求网络认证)</span><br></pre></td></tr></table></figure><script type="text/javascript" src="https://cdn.jsdelivr.net/npm/kity@2.0.4/dist/kity.min.js"></script><script type="text/javascript" src="https://cdn.jsdelivr.net/npm/kityminder-core@1.4.50/dist/kityminder.core.min.js"></script><script defer="true" type="text/javascript" src="https://cdn.jsdelivr.net/npm/hexo-simple-mindmap@0.2.0/dist/mindmap.min.js"></script><link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/hexo-simple-mindmap@0.2.0/dist/mindmap.min.css">
    </div>

    
    
    
        

<div>
<ul class="post-copyright">
  <li class="post-copyright-author">
    <strong>本文作者： </strong>lazytime
  </li>
  <li class="post-copyright-link">
    <strong>本文链接：</strong>
    <a href="https://whitestore.top/2021/01/18/jmeter-test1/" title="Jmeter压力测试回顾(一)">https://whitestore.top/2021/01/18/jmeter-test1/</a>
  </li>
  <li class="post-copyright-license">
    <strong>版权声明： </strong>本博客所有文章除特别声明外，均采用 <span class="exturl" data-url="aHR0cHM6Ly9jcmVhdGl2ZWNvbW1vbnMub3JnL2xpY2Vuc2VzL2J5LW5jLzQuMC96aC1DTg=="><i class="fa fa-fw fa-creative-commons"></i>BY-NC</span> 许可协议。转载请注明出处！
  </li>
</ul>
</div>


      <footer class="post-footer">
          <div class="post-tags">
              <a href="/tags/%E6%B5%8B%E8%AF%95/" rel="tag"># 测试</a>
          </div>

        


        
    <div class="post-nav">
      <div class="post-nav-item">
    <a href="/2021/01/15/live1/" rel="prev" title="职场的自我个人提升（一）">
      <i class="fa fa-chevron-left"></i> 职场的自我个人提升（一）
    </a></div>
      <div class="post-nav-item">
    <a href="/2021/01/18/jmeter-test1/" rel="next" title="Jmeter压力测试回顾(二)">
      Jmeter压力测试回顾(二) <i class="fa fa-chevron-right"></i>
    </a></div>
    </div>
      </footer>
    
  </article>
  
  
  



          </div>
          
    <div class="comments" id="valine-comments"></div>

<script>
  window.addEventListener('tabs:register', () => {
    let { activeClass } = CONFIG.comments;
    if (CONFIG.comments.storage) {
      activeClass = localStorage.getItem('comments_active') || activeClass;
    }
    if (activeClass) {
      let activeTab = document.querySelector(`a[href="#comment-${activeClass}"]`);
      if (activeTab) {
        activeTab.click();
      }
    }
  });
  if (CONFIG.comments.storage) {
    window.addEventListener('tabs:click', event => {
      if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return;
      let commentClass = event.target.classList[1];
      localStorage.setItem('comments_active', commentClass);
    });
  }
</script>

        </div>
          
  
  <div class="toggle sidebar-toggle">
    <span class="toggle-line toggle-line-first"></span>
    <span class="toggle-line toggle-line-middle"></span>
    <span class="toggle-line toggle-line-last"></span>
  </div>

  <aside class="sidebar">
    <div class="sidebar-inner">

      <ul class="sidebar-nav motion-element">
        <li class="sidebar-nav-toc">
          文章目录
        </li>
        <li class="sidebar-nav-overview">
          站点概览
        </li>
      </ul>

      <!--noindex-->
      <div class="post-toc-wrap sidebar-panel">
          <div class="post-toc motion-element"><ol class="nav"><li class="nav-item nav-level-1"><a class="nav-link" href="#回顾jmeter压力测试（一）"><span class="nav-number">1.</span> <span class="nav-text">回顾jmeter压力测试（一）</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#前言："><span class="nav-number">1.1.</span> <span class="nav-text">前言：</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#什么是压力测试？"><span class="nav-number">1.2.</span> <span class="nav-text">什么是压力测试？</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#什么是apach-Jmeter"><span class="nav-number">1.3.</span> <span class="nav-text">什么是apach Jmeter:</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#常用压力测试工具比较："><span class="nav-number">1.4.</span> <span class="nav-text">常用压力测试工具比较：</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#loadrunner"><span class="nav-number">1.4.1.</span> <span class="nav-text">loadrunner</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#apache-ab-单接口压测最方便"><span class="nav-number">1.4.2.</span> <span class="nav-text">apache ab(单接口压测最方便)</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#webbench"><span class="nav-number">1.4.3.</span> <span class="nav-text">webbench</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#Apache-JMeter的功能"><span class="nav-number">1.5.</span> <span class="nav-text">Apache JMeter的功能:</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#使用场景及优点"><span class="nav-number">1.6.</span> <span class="nav-text">使用场景及优点</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#如何学习："><span class="nav-number">1.7.</span> <span class="nav-text">如何学习：</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#我要怎么做？"><span class="nav-number">1.8.</span> <span class="nav-text">我要怎么做？</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#配置jdk环境："><span class="nav-number">1.8.1.</span> <span class="nav-text">配置jdk环境：</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#下载Jmeter："><span class="nav-number">1.8.2.</span> <span class="nav-text">下载Jmeter：</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#jmeter包结构解释："><span class="nav-number">1.9.</span> <span class="nav-text">jmeter包结构解释：</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#改变jmeter的GUI界面语言版本"><span class="nav-number">1.10.</span> <span class="nav-text">改变jmeter的GUI界面语言版本</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#控制台修改"><span class="nav-number">1.10.1.</span> <span class="nav-text">控制台修改</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#配置文件修改"><span class="nav-number">1.10.2.</span> <span class="nav-text">配置文件修改</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#详细介绍："><span class="nav-number">1.11.</span> <span class="nav-text">详细介绍：</span></a></li></ol></li><li class="nav-item nav-level-1"><a class="nav-link" href="#摘抄："><span class="nav-number">2.</span> <span class="nav-text">摘抄：</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#接口测试的要点："><span class="nav-number">2.1.</span> <span class="nav-text">接口测试的要点：</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#接口响应状态码："><span class="nav-number">2.2.</span> <span class="nav-text">接口响应状态码：</span></a></li></ol></li></ol></div>
      </div>
      <!--/noindex-->

      <div class="site-overview-wrap sidebar-panel">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
  <p class="site-author-name" itemprop="name">阿东</p>
  <div class="site-description" itemprop="description">随遇而安</div>
</div>
<div class="site-state-wrap motion-element">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
          <a href="/archives/">
        
          <span class="site-state-item-count">239</span>
          <span class="site-state-item-name">日志</span>
        </a>
      </div>
      <div class="site-state-item site-state-categories">
            <a href="/categories/">
          
        <span class="site-state-item-count">36</span>
        <span class="site-state-item-name">分类</span></a>
      </div>
      <div class="site-state-item site-state-tags">
            <a href="/tags/">
          
        <span class="site-state-item-count">37</span>
        <span class="site-state-item-name">标签</span></a>
      </div>
  </nav>
</div>
  <div class="links-of-author motion-element">
      <span class="links-of-author-item">
        <span class="exturl" data-url="aHR0cHM6Ly9naXRodWIuY29tL2xhenlUaW1lcw==" title="GitHub → https:&#x2F;&#x2F;github.com&#x2F;lazyTimes"><i class="fa fa-fw fa-github"></i>GitHub</span>
      </span>
      <span class="links-of-author-item">
        <span class="exturl" data-url="bWFpbHRvOjEwOTc0ODM1MDhAcXEuY29t" title="E-Mail → mailto:1097483508@qq.com"><i class="fa fa-fw fa-envelope"></i>E-Mail</span>
      </span>
  </div>


  <div class="links-of-blogroll motion-element">
    <div class="links-of-blogroll-title">
      <i class="fa fa-fw fa-link"></i>
      友情链接
    </div>
    <ul class="links-of-blogroll-list">
        <li class="links-of-blogroll-item">
          <span class="exturl" data-url="aHR0cHM6Ly93d3cuNTJwb2ppZS5jbi9ob21lLnBocD9tb2Q9c3BhY2UmdWlkPTE0OTc3MTgmZG89dGhyZWFkJnZpZXc9bWUmZnJvbT1zcGFjZQ==" title="https:&#x2F;&#x2F;www.52pojie.cn&#x2F;home.php?mod&#x3D;space&amp;uid&#x3D;1497718&amp;do&#x3D;thread&amp;view&#x3D;me&amp;from&#x3D;space">吾爱破解</span>
        </li>
        <li class="links-of-blogroll-item">
          <span class="exturl" data-url="aHR0cHM6Ly9qdWVqaW4uaW0vdXNlci8yOTk5MTIzNDUyNjI2MzY2" title="https:&#x2F;&#x2F;juejin.im&#x2F;user&#x2F;2999123452626366">掘金</span>
        </li>
        <li class="links-of-blogroll-item">
          <span class="exturl" data-url="aHR0cHM6Ly9zZWdtZW50ZmF1bHQuY29tL3UvbGF6eXRpbWVz" title="https:&#x2F;&#x2F;segmentfault.com&#x2F;u&#x2F;lazytimes">思否</span>
        </li>
    </ul>
  </div>

      </div>

      <div class="wechat_OA">
        <span>欢迎关注我的公众号</span>
        <br>
          <!-- 这里添加你的二维码图片 -->
        <img src ="https://adong-picture.oss-cn-shenzhen.aliyuncs.com/adong/wechat_channel.jpg">
      </div>
        <div class="back-to-top motion-element">
          <i class="fa fa-arrow-up"></i>
          <span>0%</span>
        </div>

    </div>
  </aside>
  <div id="sidebar-dimmer"></div>


      </div>
    </main>

    <footer class="footer">
      <div class="footer-inner">
        

        

<div class="copyright">
  
  &copy; 
  <span itemprop="copyrightYear">2023</span>
  <span class="with-love">
    <i class="fa fa-user"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">阿东</span>
    <span class="post-meta-divider">|</span>
    <span class="post-meta-item-icon">
      <i class="fa fa-area-chart"></i>
    </span>
      <span class="post-meta-item-text">站点总字数：</span>
    <span title="站点总字数">2m</span>
    <span class="post-meta-divider">|</span>
    <span class="post-meta-item-icon">
      <i class="fa fa-coffee"></i>
    </span>
      <span class="post-meta-item-text">站点阅读时长 &asymp;</span>
    <span title="站点阅读时长">29:50</span>
</div>
  <div class="powered-by">由 <span class="exturl theme-link" data-url="aHR0cHM6Ly9oZXhvLmlv">Hexo</span> & <span class="exturl theme-link" data-url="aHR0cHM6Ly90aGVtZS1uZXh0Lm9yZw==">NexT.Gemini</span> 强力驱动
  </div>

        
<div class="busuanzi-count">
  <script async src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>
    <span class="post-meta-item" id="busuanzi_container_site_uv" style="display: none;">
      <span class="post-meta-item-icon">
        <i class="fa fa-user"></i>
      </span>
      <span class="site-uv" title="总访客量">
        <span id="busuanzi_value_site_uv"></span>
      </span>
    </span>
    <span class="post-meta-divider">|</span>
    <span class="post-meta-item" id="busuanzi_container_site_pv" style="display: none;">
      <span class="post-meta-item-icon">
        <i class="fa fa-eye"></i>
      </span>
      <span class="site-pv" title="总访问量">
        <span id="busuanzi_value_site_pv"></span>
      </span>
    </span>
</div>








      </div>
    </footer>
  </div>

  
  <script src="/lib/anime.min.js"></script>
  <script src="//cdn.jsdelivr.net/npm/jquery@3/dist/jquery.min.js"></script>
  <script src="//cdn.jsdelivr.net/gh/fancyapps/fancybox@3/dist/jquery.fancybox.min.js"></script>
  <script src="/lib/velocity/velocity.min.js"></script>
  <script src="/lib/velocity/velocity.ui.min.js"></script>

<script src="/js/utils.js"></script>

<script src="/js/motion.js"></script>


<script src="/js/schemes/pisces.js"></script>


<script src="/js/next-boot.js"></script>




  




  
<script src="/js/local-search.js"></script>













  

  


<script>
NexT.utils.loadComments(document.querySelector('#valine-comments'), () => {
  NexT.utils.getScript('//unpkg.com/valine/dist/Valine.min.js', () => {
    var GUEST = ['nick', 'mail', 'link'];
    var guest = 'nick,mail,link';
    guest = guest.split(',').filter(item => {
      return GUEST.includes(item);
    });
    new Valine({
      el         : '#valine-comments',
      verify     : false,
      notify     : true,
      appId      : 'qMUpEEvBgXaMDD1b0ftgi9xr-gzGzoHsz',
      appKey     : 'UCdfT4Rfih6MO6y8DI4fstf6',
      placeholder: "Just go go",
      avatar     : 'mm',
      meta       : guest,
      pageSize   : '10' || 10,
      visitor    : false,
      lang       : 'zh-CN' || 'zh-cn',
      path       : location.pathname,
      recordIP   : false,
      serverURLs : ''
    });
  }, window.Valine);
});
</script>

</body>
</html>
